<?php
return [
    //string 监听的IP，监听本机127.0.0.1(IPv4) ::1(IPv6)，
    //监听所有地址 0.0.0.0(IPv4) ::(IPv6),默认127.0.0.1
    'listen_ip'     => env('LARAVELS_LISTEN_IP', '127.0.0.1'),
    //int 监听的端口，如果端口小于1024则需要root权限，default 5200
    'listen_port'   => env('LARAVELS_LISTEN_PORT', 5200),
    //bool 当通过LaravelS响应数据时，是否启用gzip压缩响应的内容，依赖于库zlib，通过命令php --ri swoole|grep zlib查看gzip是否可用。如果开启则会自动加上头部Content-Encoding，默认false，推荐开启gzip，会更省网络流量
    'enable_gzip'   => env('LARAVELS_ENABLE_GZIP', true),
    //string 当通过LaravelS响应数据时，设置HTTP头部Server的值，若为空则不设置
    'server'        => env('LARAVELS_SERVER', 'LaravelS'),
    //bool 是否开启LaravelS处理静态资源(要求 Swoole >= 1.7.21，若Swoole >= 1.9.17则由Swoole自己处理)，默认false，建议Nginx处理静态资源，LaravelS仅处理动态资源。静态资源的默认路径为base_path('public')，可通过修改swoole.document_root变更
    'handle_static' => env('LARAVELS_HANDLE_STATIC', false),
    'swoole'        => [
        'dispatch_mode' => 2,
        'max_request'   => 3000,
        'daemonize'     => 1,
        'pid_file'      => storage_path('laravels.pid'),
        'log_file'      => storage_path('logs/swoole-' . date('Y-m-d') . '.log'),
        'log_level'     => 4,
        'document_root' => base_path('public'),
        /**
         * The other settings of Swoole like worker_num, backlog ...
         * @see https://wiki.swoole.com/wiki/page/274.html  Chinese
         * @see https://www.swoole.co.uk/docs/modules/swoole-server/configuration  English
         */
    ],
];
